package com.hhj.king.eurake.client;


import org.apache.http.HttpResponse;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.util.EntityUtils;

import java.io.IOException;

/**
 * @author KING
 * @date 2018/9/23 21:14
 */

public class TestHttpClient {
    public static void main(String[] args) throws IOException {
        CloseableHttpClient httpClient = HttpClients.createDefault();
        for (int i = 0; i < 10; i++) {
            HttpGet httpGet = new HttpGet("http://localhost:9000/router");
            HttpResponse httpResponse = httpClient.execute(httpGet);
            System.out.println(EntityUtils.toString(httpResponse.getEntity()));
        }
    }
}
